package com.dance.netty.nio.demo;

import java.nio.ByteBuffer;

public class ByteBufferPutAndGet {

    public static void main(String[] args) {

        ByteBuffer buffer = ByteBuffer.allocate(1024);

        buffer.putInt(1).putDouble(0.02).putLong(32312312L).putShort((short) 12).putChar('舞');

        buffer.flip();

        System.out.println(buffer.getInt());
        System.out.println(buffer.getDouble());
        System.out.println(buffer.getLong());
        System.out.println(buffer.getShort());
        System.out.println(buffer.getChar());

    }

}
